# example data
for index, row in id_rms_df.iterrows():
mu = np.array(row['rms']).mean() # mean of distribution
sigma = np.array(row['rms']).std() # standard deviation of distribution
fig, ax = plt.subplots(figsize=(10,4))
# the histogram of the data
n, bins, patches = ax.hist(row['rms'], num_bins, density=1, edgecolor='black', linewidth=1.2)
# add a 'best fit' line
y = ((1 / (np.sqrt(2 * np.pi) * sigma)) *
np.exp(-0.5 * (1 / sigma * (bins - mu))**2))
ax.plot(bins, y, '--')
ax.set_xlabel(' -- RMS -- ')
ax.set_ylabel(' -- No of fragments -- ')
ax.set_title('RMS Distribution of ' + row['seq1'])
ax.text(2.3, 15, 'Sequence: ' + row['seq1'], style='italic',
bbox={'facecolor':'red', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 10, 'Skew: ' + str(skew(row['rms']))[:8], style='italic',
bbox={'facecolor':'yellow', 'alpha': 0.5, 'pad':10})
ax.text(2.3, 5, 'Kurtosis: ' + str(kurtosis(row['rms']))[:8], style='italic',
bbox={'facecolor':'lightblue', 'alpha': 0.5, 'pad':10})
ax.set_xticks(x_x)
ax.set_yticks(y_y)
# Tweak spacing to prevent clipping of ylabel
fig.tight_layout()
plt.show()
# print('Sequence: ' + row['seq'])
# print('Skew: ', skew(row['RMS Value']))
# print('Kurtosis: ', kurtosis(row['RMS Value']))